﻿#region 文件信息

// FileName: SoCafeShop/Sohobloo.SoAuth.Service/ActionService.cs
// Author: Sohobloo
// CreateTime: 2013/06/30 11:51
// UpdateTime: 2013/06/30 12:08

#endregion

#region 引用

using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using Sohobloo.SoAuth.Data.Repositories;
using Sohobloo.SoAuth.Entity;
using Sohobloo.SoMcCoffee.Public.OperationResult;

#endregion

namespace Sohobloo.SoAuth.Service.Impl
{
    [Export(typeof (IPermissionService))]
    internal class PermissionService : ServiceBase, IPermissionService
    {
        #region 属性

        [Import]
        IRoleRepository RoleRepository { get; set; }

        #endregion 属性

        #region Implementation of IPermissionService

        public OperationResult CreatePermission(Guid roleId, Guid actionId)
        {
            throw new NotImplementedException();
        }

        public OperationResult DeletePermission(Guid permissionId)
        {
            throw new NotImplementedException();
        }

        public ICollection<SoAuthPermission> GetRolePermissionList(Guid roleId)
        {
            return RoleRepository.GetByKey(roleId).RolePermissions;
        }

        #endregion
    }
}